package web.utils;

import javax.servlet.http.HttpServletRequest;

/**
 *
 * @author José
 * @date 18/02/2011
 */

public class BrowserInformation
{
    private static final String MOVILE_BROWSER_REGEX = "Android";

    public static boolean isMovileBrowser (HttpServletRequest pRequest)
    {
        if (pRequest == null)
        {
            System.out.println ("REQUESTX: NULLL---------------------------");
            return false;
        }
        
        if (pRequest.getHeader ("user-agent") != null)
        {
            
            return pRequest.getHeader ("user-agent").contains (MOVILE_BROWSER_REGEX);
        }
        else
        {
            return false;
        }
    }
}
